package de.gameduell.framework.threads 
{
	import flash.display.MovieClip;
	import de.gameduell.framework.queue.*;
	
	/**
	 * ...
	 * @author Ferry Trunschke
	 */
	public class ThreadPoolTest extends MovieClip
	{
		
		public function ThreadPoolTest()  {
			
			// SETUP -----------------------------------------------------
			
			// register blocking callback manager (delegate)
			GDActionQueue.getInstance().registerThreadPoolManager(new ThreadPoolManager(), [GDActionQueue.MAIN_QUEUE, GDActionQueue.POPUP_QUEUE]);
			
			// TEST -----------------------------------------------------
			
			// before
			GDActionQueue.getInstance().add(new DelayAction(5000), GDActionQueue.MAIN_QUEUE);
			GDActionQueue.getInstance().add(new DelayAction(3000), GDActionQueue.POPUP_QUEUE);
			GDActionQueue.getInstance().add(new DelayAction(2000), GDActionQueue.CHAT_QUEUE);

			// global delay
			GDActionQueue.getInstance().add(new DelayAction(5000), null);
			GDActionQueue.getInstance().add(new DelayAction(5000), null);

			// after
			GDActionQueue.getInstance().add(new DelayAction(5000), GDActionQueue.MAIN_QUEUE);
			GDActionQueue.getInstance().add(new DelayAction(3000), GDActionQueue.POPUP_QUEUE);			
			GDActionQueue.getInstance().add(new DelayAction(2000), GDActionQueue.CHAT_QUEUE);
		}
		
	}

}